package com.thn.news.remote.service.comment;

import com.thn.news.remote.model.Comment;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient(name="comment-service")
@Component
public interface CommentFeign {

    @GetMapping("/api/comments")
    List<Comment> getAllComments();

    @GetMapping("/api/comments/{id}")
    Comment getCommentById(@PathVariable Long id);

    @PostMapping("/api/comments")
    boolean createComment(@RequestBody Comment comment);

    @PostMapping("/api/comments/{id}")
    boolean updateComment(@PathVariable Integer id, @RequestBody Comment comment);

    @DeleteMapping("/{id}")
    boolean deleteComment(@PathVariable Long id);
}
